<?php
/**
 * Created by PhpStorm.
 * User: addd
 * Date: 2020/10/16
 * Time: 18:21
 */
namespace App\Admin\Selectable;

use Encore\Admin\Grid\Filter;
use Encore\Admin\Grid\Selectable;
use App\Models\Goods as good;

class Goods extends Selectable
{
    public $model = good::class;

    public function make()
    {
        $this->column('id');
        $this->column('name','商品名称');
        $this->column('number','商品数量')->editable();
        $this->filter(function (Filter $filter) {
            // 去掉默认的id过滤器
            $filter->disableIdFilter();
            $filter->like('name','商品名称');
        });
    }

    public function column($name, $label = '')
    {
        return parent::column($name, $label); // TODO: Change the autogenerated stub
    }


}
